//商品分类管理Api
import {get, post, put, del} from "../utils/request";

export function fetchListWithChildren() {
    return get('/product/category/list/children')
}

//分页获取数据
export function fetchList(parentId, params) {
    return get('/product/category/list/' + parentId, params)
}

//删除商品分类
export function deleteProductCate(id) {
    return del('/product/category/del/' + id)
}

//批量修改显示状态
export function updateShowStatus(data) {
    return post('/product/category/update/show', data);
}

//批量修改导航状态
export function updateNavStatus(data) {
    return post('/product/category/update/nav', data);
}

//新增商品分类
export function createProductCate(data) {
    return post('/product/category/insert', data);
}

//更新商品分类
export function updateProductCate(id, data) {
    return post('/product/category/update/' + id, data);
}

//获取商品分类
export function getProductCate(id) {
    return get('/product/category/getitem/' + id)
}